-module (osmos_compare).

-export ([ binary/0, term/0 ]).

-include ("osmos_compare.hrl").

binary () ->
% XXX: with the funs inline, dialyzer thinks there is no local return
  Prepare = fun osmos_format:identity/1,
  Less = fun erlang_less/2,
  #osmos_compare { prepare = Prepare, less = Less }.

term () ->
  Prepare = fun erlang:binary_to_term/1,
  Less = fun erlang_less/2,
  #osmos_compare { prepare = Prepare, less = Less }.

erlang_less (A, B) ->
  A < B.
